package com.atguigu.edu.controller;

import com.atguigu.commonutils.R;
import com.atguigu.edu.service.TeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(description="登录管理")
@CrossOrigin //解决跨域
@RequestMapping("/edu/user")
public class EduLoginController {
    @Autowired
    private TeacherService teacherService;

    @ApiOperation(value = "登录")
    @RequestMapping("/login")
    public R login(){
        return R.ok().data("token", "admin");
    }

    @ApiOperation(value = "返回用户信息")
    @RequestMapping("/info")
    public R info(){
        String avatar = "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif";
        return R.ok().data("roles", "[admin]").data("name","admin").data("avatar",avatar);
    }
}
